home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_02
/
ctimer.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1990-09-28
|
349 b
|
21 lines
#include <dos.h>
#define TimerResolution 1193181.667
void cardinal(long l, double *result)
{
*result = ((l < 0) ? (double)4294967296.0 + (long) l : (double)((long) l));
}
void elapsedtime(long start, long stop, double *result)
{
double r;
cardinal(stop - start,&r);
*result = (1000.0 * r) / TimerResolution;
}